package com.zzty.dendi.controller;

import com.zzty.dendi.entity.Clazz;
import com.zzty.dendi.mapper.ClassMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/class")
public class ClassController {
    @Autowired
    ClassMapper classMapper;

    @RequestMapping(value = "/getClazzById/{id}")
    @ResponseBody
    public Clazz getClassById(@PathVariable("id") String id){

        Clazz clazz=classMapper.getClazzById(Integer.valueOf(id));
        return  clazz;
    }

}
